Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show blacklisted req/caps on resolve failure #5906

Merged

Conversation

chrisrueger
Copy link
Contributor

What is it

1st draft of an attempt to improve and enrich the Resolution failure output with information about blacklisted items which were not considered for resolution. The goal is to make it easier to spot resolution failure because of a too broad blacklist. This is based on a real use case (see bndtools/bndtools.workspace.min#11 (comment) ) where the blacklist was the reason for failed resolving, but the current tooling gave no indication about this.

Although it was an OSI-layer 8 problem, it would have made the chase easier, if there was some kind of pointer to the -runblacklist

Example output

image
Resolution failed. Summary:
      ⇒ Bundle: servicetest.consumer cannot be resolved
              ⇒ Extender: &(osgi.extender=osgi.component)(version=[1.5.0,2.0.0)) cannot be resolved
                      ⇒ because Import-Package requirement for: org.osgi.service.component; version=[1.5.0,1.6.0) could not be provided by any available bundle or dependency

Note: The summary above may be incomplete. Please check the full output below for more hints.
Resolution failed. Capabilities satisfying the following requirements could not be found:

    [<<INITIAL>>]
      ⇒ osgi.identity: (osgi.identity=servicetest.consumer)
          ⇒ [servicetest.consumer version=1.0.0.202311271939]
              ⇒ osgi.extender: (&(osgi.extender=osgi.component)(version>=1.5.0)(!(version>=2.0.0)))
                  ⇒ [org.apache.felix.scr version=2.2.6]
                      ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.osgi.service.component)(version>=1.5.0)(!(version>=1.6.0)))

Blacklisted Capabilities: Some requirements could not be satisfied because of blacklisted capabilities in -runblacklist:
org.osgi.service.component version=1.5.1.202212101352 is ignored because it is blacklisted although providing required capability osgi.wiring.package(&(osgi.wiring.package=org.osgi.service.component)(version>=1.5.0)(!(version>=1.6.0)))


All Blacklisted Capabilities:
osgi.core version=6.0.0.201403061837 providing capability osgi.wiring.package:org.osgi.framework.startlevel ignored
osgi.core version=8.0.0.202007221806 providing capability osgi.wiring.package:org.osgi.dto ignored
osgi.core version=8.0.0.202007221806 providing capability osgi.wiring.package:org.osgi.framework ignored
osgi.core version=6.0.0.201403061837 providing capability osgi.wiring.package:org.osgi.framework.dto ignored
osgi.core version=6.0.0.201403061837 providing capability osgi.wiring.package:org.osgi.util.tracker ignored
osgi.core version=8.0.0.202007221806 providing capability osgi.wiring.package:org.osgi.util.tracker ignored
osgi.core version=8.0.0.202007221806 providing capability osgi.wiring.package:org.osgi.resource ignored
osgi.core version=6.0.0.201403061837 providing capability osgi.wiring.package:org.osgi.framework ignored
osgi.core version=6.0.0.201403061837 providing capability osgi.wiring.package:org.osgi.framework.wiring ignored
osgi.core version=6.0.0.201403061837 providing capability osgi.wiring.package:org.osgi.resource ignored
org.osgi.service.component version=1.5.1.202212101352 providing capability osgi.wiring.package:org.osgi.service.component ignored
osgi.core version=8.0.0.202007221806 providing capability osgi.wiring.package:org.osgi.framework.startlevel ignored
osgi.core version=8.0.0.202007221806 providing capability osgi.wiring.package:org.osgi.framework.wiring ignored
osgi.core version=8.0.0.202007221806 providing capability osgi.wiring.package:org.osgi.framework.dto ignored


All Blacklisted Resources
slf4j.api__8 version=2.0.9 type=bnd.synthetic
slf4j.api__9 version=2.0.9 type=bnd.synthetic
slf4j.simple__8 version=2.0.9 type=bnd.synthetic
slf4j.simple__9 version=2.0.9 type=bnd.synthetic
slf4j.nop__8 version=2.0.9 type=bnd.synthetic
slf4j.nop__9 version=2.0.9 type=bnd.synthetic
org.osgi.service.metatype.annotations version=1.4.1.202109301733
org.osgi.service.transaction.control version=1.0.0.201802012107
org.osgi.service.component.annotations version=1.5.1.202212101352
org.osgi.service.networkadapter version=1.0.1.202109301733
org.osgi.service.repository version=1.1.0.201505202024
org.osgi.service.zigbee version=1.0.1.202109301733
org.osgi.service.packageadmin version=1.2.1.202007221806
org.osgi.service.application version=1.1.0.201505202023
org.osgi.service.log version=1.5.0.202007221806
org.osgi.service.clusterinfo version=1.0.0.201802012106
org.osgi.service.blueprint version=1.0.2.201505202024
org.osgi.service.feature version=1.0.0.202109301733
org.osgi.service.permissionadmin version=1.2.1.202007221806
org.osgi.service.condpermadmin version=1.1.2.202007221806
org.osgi.service.configurator version=1.0.1.202109301733
org.osgi.service.onem2m version=1.0.0.202109301733
slf4j.osgi version=2.0.0
org.osgi.service.enocean version=1.0.1.202109301733
org.osgi.service.http.whiteboard version=1.1.1.202109301733
org.osgi.service.rest version=1.0.0.201505202024
org.osgi.service.serviceloader version=1.0.0.201505202024
org.osgi.service.servlet version=2.0.0.202212101352
org.osgi.service.startlevel version=1.1.1.202007221806
org.osgi.service.dmt version=2.0.2.201802012106
org.osgi.service.monitor version=1.0.0.201505202023
org.osgi.service.jndi version=1.0.1.202109301733
org.osgi.service.typedevent version=1.0.0.202109301733
slf4j.api version=2.0.9
org.osgi.service.usbinfo version=1.0.1.202109301733
org.osgi.service.condition version=1.0.0.202007221806
org.osgi.service.subsystem version=1.1.0.201505202024
org.osgi.service.device version=1.1.1.202109301733
org.osgi.service.metatype version=1.4.1.202109301733
org.osgi.service.resourcemonitoring version=1.0.1.202109301733
org.osgi.service.async version=1.0.0.201505202023
slf4j.simple version=2.0.9
org.osgi.service.deploymentadmin version=1.1.0.201505202023
osgi.core version=6.0.0.201403061837
org.osgi.service.prefs version=1.1.2.202109301733
org.osgi.service.dal version=1.0.2.202109301733
org.osgi.service.remoteserviceadmin version=1.1.0.201505202024
org.osgi.service.http version=1.2.2.202109301733
org.osgi.service.coordinator version=1.0.2.201505202024
org.osgi.service.jdbc version=1.1.0.202212101352
org.osgi.service.cm version=1.6.1.202109301733
org.osgi.service.wireadmin version=1.0.2.202109301733
org.osgi.service.url version=1.0.1.202007221806
org.osgi.service.cdi version=1.0.1.202109301733
org.osgi.service.dal.functions version=1.0.1.202109301733
slf4j.nop version=2.0.9
org.osgi.service.tr069todmt version=1.0.2.202109301733
osgi.cmpn version=5.0.0.201305092017
org.osgi.service.provisioning version=1.2.0.201505202024
org.osgi.service.component version=1.5.1.202212101352
org.osgi.service.event version=1.4.1.202109301733
org.osgi.service.useradmin version=1.1.1.202109301733
org.osgi.service.jakartars version=2.0.0.202212101352
org.osgi.service.log.stream version=1.0.0.202109301733
org.osgi.service.jaxrs version=1.0.1.202109301733
org.osgi.service.jpa version=1.1.1.202109301733
org.osgi.service.serial version=1.0.1.202109301733
org.osgi.service.upnp version=1.2.1.202109301733
org.osgi.service.io version=1.0.0.201505202023
osgi.core version=8.0.0.202007221806
org.osgi.service.resolver version=1.1.1.202007221806

TODO discussion and cleanup needed.

This is only a base for discussion.
We could build up on this to make the output more precise or use the information also in other places for more subtle UI-indicators. E.g. @pkriens suggested on slack:

black listing is on resource level. Maybe we should gray out the resource in the Repositories list in the Resolution window?
...
I like the greying out + tooltip: I am in the blacklist!

1st draft of an attempt to improve and enrich the Resolution failure output with information about blacklisted items which were not considered for resolution.
The goal is to make it easier to spot resolution failure because of a too broad blacklist. This is based on a real use case where the blacklist was the reason, but the current tooling gave no indication about this.

TODO discussion and cleanup needed

Signed-off-by: Christoph Rueger <[email protected]>
@pkriens
Copy link
Member

pkriens commented Nov 28, 2023

This looks wonderful! You really check the blacklists!

Slight concern that sometimes a resource really should be in the blacklist even though it provides the resource. E.g. the aggregates cmpn, enterprise, should really be in the blacklist although they provide many packages. Then again, these aggregates nowadays have an unresolved requirement, which I think became a standard namespace in OSGi?

Blacklists are really a bit from before we had the unresolved requirements.

If you can take a look at the warning and verify you can't get NPE's, I am ok to go

Copy link
Contributor Author

@chrisrueger chrisrueger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing @pkriens

I will do some more code cleanup.
Question about this:

  • Naming things: BndResolutionException instead of ResolutionExceptionWithDetails

@chrisrueger
Copy link
Contributor Author

Slight concern that sometimes a resource really should be in the blacklist even though it provides the resource. E.g. the aggregates cmpn, enterprise, should really be in the blacklist although they provide many packages. Then again, these aggregates nowadays have an unresolved requirement, which I think became a standard namespace in OSGi?

Sorry I must admit that I do not understand that part. Is there anything I should do here?

If you can take a look at the warning and verify you can't get NPE's, I am ok to go

Done.
I think based on the above we could also think about adding similar UI functionality to Resolution-View in another PR.

@chrisrueger chrisrueger marked this pull request as ready for review November 28, 2023 15:45
@pkriens
Copy link
Member

pkriens commented Nov 28, 2023

Looks good to me, can I merge?

@chrisrueger
Copy link
Contributor Author

Yes

@pkriens pkriens merged commit c2cd328 into bndtools:master Nov 28, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants